<template>
  <div class="maccontainer _maccontainer">
    <el-carousel :interval="4000" type="card" height="300px">
      <el-carousel-item v-for="item in list" :key="item.id">
        <h3 class="medium">
          <QingFenLunJiu :info="item" />
        </h3>
      </el-carousel-item>
    </el-carousel>
    <ConTent />
  </div>
</template>

<script>
import QingFenLunJiu from "./subcomponents/QingFenLunJiu";
import ConTent from "./subcomponents/ConTent";
import { getAsyncList } from "@/api/member";
import { openLoading, closeLoading } from "@/public/js/loading";
export default {
  name: "Mac",
  components: {
    QingFenLunJiu,
    ConTent,
  },
  data() {
    return {
      list: [],
    };
  },
  methods: {
    async getList() {
      try {
        openLoading();
        const { data } = await getAsyncList();
        closeLoading();
        this.list = data;
      } catch (e) {
        this.$message.error(e);
        closeLoading();
      }
    },
  },
  created() {
    this.getList();
  },
};
</script>

<style lang="less" scoped>
.maccontainer _maccontainer {
  .el-carousel__item h3 {
    color: #475669;
    font-size: 14px;
    opacity: 0.75;
    line-height: 200px;
    margin: 0;
  }

  .el-carousel__item:nth-child(2n) {
    background-color: #99a9bf;
  }

  .el-carousel__item:nth-child(2n + 1) {
    background-color: #d3dce6;
  }

  // 大于800px
  @media only screen and (min-width: 800px) {
  }

  // 小于800px
  @media only screen and (max-width: 800px) {
  }
}
</style>
